25. Quiz: Techniques for Importing Modules

Importing and accessing from modules

In this quiz, you'll be using different methods to import and use the random.randint() function from the random module. Your task is to match the import statement with the way you would then call the function itself.

QUIZ QUESTION: :

Match the import statement with the way that random.randint() is called.

ANSWER CHOICES:



Import statement

Calling the function

rd.randint(0,10)

Don't use this import statement!

rint(0,10)

randint(0,10)

random.randint(0,10)

SOLUTION:

Import statement

Calling the function

rd.randint(0,10)

Don't use this import statement!

rint(0,10)

randint(0,10)

random.randint(0,10)